﻿@using MvcApplication4.Controllers
@using Omu.AwesomeMvc
@model MvcApplication4.Models.tb_Vacinacao

@{
    ViewBag.Title = "Editar Vacinação";
}

<h2>Editar Vacinação</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Editar Vacinações Aplicadas</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.ID_Vacinacao, "ID Vacinação")
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.ID_Vacinacao, new { @readonly = "readonly"})
            @Html.ValidationMessageFor(model => model.ID_Vacinacao)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ID_Paciente, "Paciente")
        </div>
        <div class="editor-field">
             @(Html.Awe().Autocomplete("Nome").PropId(o => o.ID_Paciente).Controller<NomeAutocompleteController>())
            @Html.HiddenFor(o => o.ID_Paciente) 
            @Html.ValidationMessageFor(model => model.ID_Paciente)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ID_Funcionario, "Funcionário")
        </div>
        <div class="editor-field">
             @Html.DropDownList("ID_Funcionario")
            @Html.ValidationMessageFor(model => model.ID_Funcionario)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ID_UBS, "UBS")
        </div>
        <div class="editor-field">
            @(Html.Awe().AjaxDropdownFor(o => o.ID_UBS).Parent("ID_Funcionario").Controller<UBSAjaxDropdownController>())
            @Html.ValidationMessageFor(model => model.ID_UBS)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ID_Vacina, "Vacina")
        </div>
        <div class="editor-field">
            @Html.DropDownList("ID_Vacina", String.Empty)
            @Html.ValidationMessageFor(model => model.ID_Vacina)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ID_Lote, "LOTE")
        </div>
        <div class="editor-field">
            @(Html.Awe().AjaxDropdownFor(o => o.ID_Lote).Parent(o => o.ID_Vacina).Controller<LoteAjaxDropdownController>())
            @Html.ValidationMessageFor(model => model.ID_Lote)
        </div>

@*        <div class="editor-label">
            @Html.LabelFor(model => model.Hora)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Hora)
            @Html.ValidationMessageFor(model => model.Hora)
        </div>*@

        <div class="editor-label">
            @Html.LabelFor(model => model.Data_Vacinacao, "Data Vacinação")
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.Data_Vacinacao, new { @readonly = "readonly" })
            @Html.ValidationMessageFor(model => model.Data_Vacinacao)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Motivo)
        </div>
        <div class="editor-field">
             @(Html.Awe().AjaxDropdownFor(o => o.Motivo).Controller<MotivoAjaxDropdownController>())
            @Html.ValidationMessageFor(model => model.Motivo)
        </div>

        <p>
            <input type="submit" value="Salvar" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Voltar", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
